package com.rightsidetech.trade.mapper;

import com.rightsidetech.trade.dtos.request.TdOrderSalesVolumeDayStatisReq;
import com.rightsidetech.trade.dtos.response.TdOrderIncomeRefundDayStatisResp;
import com.rightsidetech.trade.dtos.response.TdOrderSalesVolumeDayStatisResp;
import com.rightsidetech.trade.entity.TdOrderIncomeSalesDayStatis;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface TdOrderIncomeSalesDayStatisMapper {
    int deleteByPrimaryKey(Long id);

    int insert(TdOrderIncomeSalesDayStatis record);

    int insertSelective(TdOrderIncomeSalesDayStatis record);

    TdOrderIncomeSalesDayStatis selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(TdOrderIncomeSalesDayStatis record);

    int updateByPrimaryKey(TdOrderIncomeSalesDayStatis record);

    List<TdOrderSalesVolumeDayStatisResp> selectSalesVolumeList(TdOrderSalesVolumeDayStatisReq req);

    //Long selectSalesVolumeList_COUNT(TdOrderSalesVolumeDayStatisReq req);

    List<TdOrderIncomeRefundDayStatisResp> selectIncomeRefundList(TdOrderSalesVolumeDayStatisReq req);

    TdOrderIncomeSalesDayStatis selectByStoreIdAndDate(@Param("storeId") Long storeId,@Param("statisTime") String statisTime, @Param("source") String source);
    
    //Long selectIncomeRefundList_COUNT(TdOrderSalesVolumeDayStatisReq req);

    BigDecimal selectSumIncomeAmountByPayTypeAndStatisAt(@Param("payType") Byte payType,@Param("statisAt") String statisAt);

    BigDecimal selectSumRefundAmountByPayTypeAndStatisAt(@Param("payType") Byte payType,@Param("statisAt") String statisAt);
}